package com.homework.client;

import com.baomidou.mybatisplus.extension.api.R;
import com.homework.search.dto.SearchResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(name = "hw-search")
public interface HwSearchClient {

    @RequestMapping("/hw-search/search/{current}/{size}")
    R<SearchResultDTO> search(@PathVariable("current") Integer current, @PathVariable("size") Integer size, @RequestParam("keyword") String keyword);

    /**
     * 注意需要admin权限
     * @return
     */
    @RequestMapping("/hw-search/admin/initEsIndex")
    R initEsIndex();
}
